{% extends "gtug/admin/base.html" %}

{% block script %}
<script type="text/javascript">
function del(id)
{
    if(confirm("Confirma a exclusão?"))
    {
        window.location='/admin/post/delete/'+id+'/';
    }
}
</script>
{% endblock %}

{% block content %}

        <table class="lista" border="0" width="80%">
            <tr>
                <th>Key</th>
                <th>Título</th>
                <th>Public</th>
                <th>Usuário</th>
                <th>Act</th>
            </tr>
            {% for item in items %}
            <tr>
                <td>{{ item.key.id }}</td>
                <td>{{ item.title }}</td>
                <td>{{ item.published|date:"d/m/Y H:i" }}</td>
                <td>{{ item.user_author.name }}</td>
                <td>{% ifequal profile.id 1 %}<a href="/admin/post/{{ item.key.id }}/">Edt</a> | <a href="javascript:del('{{ item.key.id }}');">Del</a>{% endifequal %}</td>
            </tr>
            {% endfor %}
        </table>

{% endblock %}

{% block title %}Listando posts{% endblock %}
